<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<!-- 增加和修改可以是同一个界面也可以是单独的两个 -->
		<!-- 但是修改的时候一定要传值,根据id进o行查询 -->
		<form action="/oksave" method="post">
			<input type="hidden"  name="id" th:value="${student?.id}" />
			<p>姓名:<input type="text" id="name" name="name" th:value="${student?.name}" /></p>
			<p>性别:kjhgkjh
				<input type="radio" name="sex"
					   th:value="男"
					   th:attr ="checked=${'男' ==student?.sex?true:false}">男

				<input type="radio" name="sex"
					   th:value="女"
					   th:attr ="checked=${'女' == student?.sex?true:false}">女
			</p>
			<p>年级:
				<!-- 这里不能写死  必须从数据库查出来 -->
				<select name="gradeId">
					<option  			th:each="gradeList:${gradeList}"
										th:selected="${student?.getGradeId() eq gradeList?.getGradeId()}"
										 th:value="${gradeList?.getGradeId()}"
										 th:text="${gradeList?.getGradeName()}" >
					</option>
				</select>


			<!--	<select name="gradeId"  th:each="grade:${gradeList}">
					&lt;!&ndash;<option th:text="${grade?.getGradeName()}" th:value="${grade?.getGradeId()}" th:selected="${student?.getGradeId() eq grade?.getGradeId()}"></option>&ndash;&gt;
					<option th:text="${grade?.getGradeName()}"></option>
					&lt;!&ndash;	<option value="2" th:selected="${student?.getGradeId()==gradeList.getGradeId()}">S2</option>
					<option value="3" th:selected="${student?.getGradeId()==gradeList.getGradeId()}">Y2</option>&ndash;&gt;
					</select>-->


			</p>
			<input type="submit" value="增加"/>
		</form>
	</body>
</html>
